﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Master_Page/Master_IPORT.Master" CodeBehind="frm_MyBooking.aspx.vb" Inherits="I_PORT.frm_MyBooking" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<%@ Register Src="~/Control/Confirm.ascx" TagName="Confirm1" TagPrefix="Confirm" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <script type="text/javascript" language="javascript">
                    var _source;
    // keep track of the popup div
    var _popup;

    function showConfirm(customerid) {
        this._source = customerid;
        this._popup = $find('ModalPopupExtender3'); 
        this._popup.show();  
    }
       function okClick(){
        //  find the confirm ModalPopup and hide it
       this._popup.hide();

        __doPostBack(this._source.name,'');
        
    }
    
    function cancelClick(){
        //  find the confirm ModalPopup and hide it
        this._popup.hide();
    }
        function closeModal(type) {
           // document.getElementById('ctl00_contentplaceholder1_framePopup').src = 'about:blank';
           if(type == '1')
           {
           document.getElementById('ctl00_contentplaceholder1_framePopup').src = '../FormPopup/FrmTariff_Popup.aspx';
            var mpu = $find('ctl00_ContentPlaceHolder1_ModalPopupExtender1');
            mpu.hide();
            }
            else if(type == '2')
            {
            document.getElementById('ctl00_contentplaceholder1_framePopup2').src = '../FormPopup/estimate.aspx';
            var mpu = $find('ctl00_ContentPlaceHolder1_ModalPopupExtender2');
            mpu.hide();
            }
            else if (type == 'B')
            {
            document.getElementById('ctl00_contentplaceholder1_framePopup2').src = '../FormPopup/estimate.aspx';
            var mpu = $find('ctl00_ContentPlaceHolder1_ModalPopupExtender2');
            mpu.hide();
            document.getElementById('ctl00_contentplaceholder1_btnSaveBooking').click();
            }
            else if (type == 'C')
            {
            document.getElementById('ctl00_contentplaceholder1_Iframe1').src = '../FormPopup/UploadFile.aspx';
            var mpu = $find('ctl00_ContentPlaceHolder1_ModalPopupExtender4');
            mpu.hide();
            }
            else if (type == 'U')
            {
            document.getElementById('ctl00_contentplaceholder1_Iframe1').src = '../FormPopup/UploadFile.aspx';
            var mpu = $find('ctl00_ContentPlaceHolder1_ModalPopupExtender4');
            mpu.hide();
            document.getElementById('ctl00_contentplaceholder1_btnSaveUpload').click();
            }
            else if (type == 'P')
            {
            document.getElementById('ctl00_contentplaceholder1_ProductPopup').src = '../FormPopup/ProductPopup.aspx';
            var mpu = $find('ctl00_ContentPlaceHolder1_ModalPopupExtender5');
            mpu.hide();
            document.getElementById('ctl00_contentplaceholder1_btnSaveProduct').click();
            }
            else if (type == 'D')
            {
            document.getElementById('ctl00_contentplaceholder1_ProductPopup').src = '../FormPopup/ProductPopup.aspx';
            var mpu = $find('ctl00_ContentPlaceHolder1_ModalPopupExtender5');
            mpu.hide();
            }
            else if (type == '@')
            {
            document.getElementById('ctl00_contentplaceholder1_IframeDetailPopup').src = '../FormPopup/Detail_VesselBerth_Popup.aspx';
            var mpu = $find('ctl00_ContentPlaceHolder1_ModalPopupExtender9');
            mpu.hide();
            document.getElementById('ctl00_contentplaceholder1_btnReLoad').click();
            }
            else if (type == 'Y')
            {
            document.getElementById('ctl00_contentplaceholder1_CancelPopup').src = '../FormPopup/Cancel_popup.aspx';
            var mpu = $find('ctl00_ContentPlaceHolder1_ModalPopupExtender6');
            mpu.hide();
            }
            else if (type == 'Z')
            {
            document.getElementById('ctl00_contentplaceholder1_CancelPopup').src = '../FormPopup/Cancel_popup.aspx';
            var mpu = $find('ctl00_ContentPlaceHolder1_ModalPopupExtender6');
            mpu.hide();
            document.getElementById('ctl00_contentplaceholder1_btnSaveCancelBooking').click();
            }
            else
            {
            document.getElementById('ctl00_contentplaceholder1_framePopup').src = '../FormPopup/FrmTariff_Popup.aspx';
            var mpu = $find('ctl00_ContentPlaceHolder1_ModalPopupExtender1');
            mpu.hide();
            document.getElementById('ctl00_contentplaceholder1_btnLoad').click();
            }
           
        }
        function showTariff(type) {
        if (type == '1'){
             document.getElementById('ctl00_contentplaceholder1_framePopup').contentWindow.location.reload(true);
             }
             else{
             document.getElementById('ctl00_contentplaceholder1_framePopup2').contentWindow.location.reload(true);
             } 
        }
         function showproduct() {
             document.getElementById('ctl00_contentplaceholder1_ProductPopup').contentWindow.location.reload(true);

        }
        function showNew_Service() {
             document.getElementById('ctl00_contentplaceholder1_frameNew_Service').contentWindow.location.reload(true);

        }
                function closeModalNew_Service(type) {
           // document.getElementById('ctl00_contentplaceholder1_framePopup').src = 'about:blank';
           if(type == '1')
           {
           document.getElementById('ctl00_contentplaceholder1_frameNew_Service').src = '../FormPopup/New_ServicePopup.aspx';
            var mpu = $find('ctl00_ContentPlaceHolder1_ModalPopupExtenderService');
            mpu.hide();
            document.getElementById('ctl00_contentplaceholder1_btnNew_Service_LOAD').click();
            }
            else if(type == '2')
            {
            document.getElementById('ctl00_contentplaceholder1_frameNew_Service').src = '../FormPopup/New_ServicePopup.aspx';
            var mpu = $find('ctl00_ContentPlaceHolder1_ModalPopupExtenderService');
            mpu.hide();
            }
        }
        function showDetailPopup(type) {
        if (type == '1'){
             document.getElementById('ctl00_contentplaceholder1_IframeDetailPopup').contentWindow.location.reload(true);
             }
        }
        function checkNumber(e)
{
var keycode;

if (window.event) keycode = window.event.keyCode; // ใช้ IE อ่ะ

else if (e) keycode = e.which; // ใช้ Firefox เน่าะ

 if (((keycode > 47) && (keycode < 58))||(keycode == 190)||(keycode == 46))
 {
 return true;
 }
return false;
}
function tryNumberFormat(obj)
{
	obj.value = new NumberFormat(obj.value).toFormatted();
}

</script>
      <asp:UpdatePanel ID="UpdatePanelTracking" runat="server">
        <ContentTemplate>
            <table width="100%" border="0" cellpadding="0" cellspacing="0">
             <tr>
                <td>
               
               <asp:Panel ID="panelMain" runat="server">
                 <table width="100%" border="0" cellpadding="0" cellspacing="0">
                     <tr>
                        <td valign="top">
                           <table width="100%" border="0" cellpadding="2" cellspacing="0">
                           <tr>
                         <td style="width:100px;" align="right"><asp:Label ID="Label15" runat="server" SkinID="lbtxt" Text="Booking No. :"></asp:Label>&nbsp;</td>
                         <td align="left"><asp:TextBox ID="txtBooking_no" runat="server" ></asp:TextBox>
                         </td>
                           </tr>
                            <tr>
                         <td style="width:100px;" align="right"><asp:Label ID="Label18" runat="server" SkinID="lbtxt" Text="Vessel Name :"></asp:Label>&nbsp;</td>
                         <td align="left"><asp:TextBox ID="txtVesselName" runat="server" ></asp:TextBox>
                         </td>
                           </tr>
                         </table>
                        </td>
                        <td valign="top">
                           <table width="100%" border="0" cellpadding="2" cellspacing="0">
                           <tr>
                         <td style="width:100px;" align="right"><asp:Label ID="Label70" runat="server" SkinID="lbtxt" Text="Lay Can :"></asp:Label>&nbsp;</td>
                         <td align="left"><asp:TextBox ID="txtDateSearch" runat="server" Width="80px" onkeypress="return false;" ></asp:TextBox>&nbsp;<asp:ImageButton ID="ImgDateSearch" runat="server" ImageUrl="~/Image/calendar.png" />&nbsp;<asp:Label ID="Label71" runat="server" SkinID="lbtxt" Text="TO"></asp:Label>&nbsp;<asp:TextBox ID="txtDateToSearch" runat="server" Width="80px"  onkeypress="return false;" ></asp:TextBox>&nbsp;<asp:ImageButton ID="ImgDateToSearch" runat="server"  ImageUrl="~/Image/calendar.png" />
                                <asp:CalendarExtender ID="CalendarExtenderSearch5" runat="server" TargetControlID="txtDateSearch" Format="dd MMM yyyy" PopupButtonID="ImgDateSearch"></asp:CalendarExtender>
                                <asp:CalendarExtender ID="CalendarExtenderSearch6" runat="server" TargetControlID="txtDateToSearch" Format="dd MMM yyyy" PopupButtonID="ImgDateToSearch" ></asp:CalendarExtender>
                      </td>
                    </tr>
                     <tr>
                        <td style="width:100px;" align="right">&nbsp;</td>
                        <td align="left"><asp:Button ID="btnSerachMyBooking" runat="server" Text="Search" CssClass="ButtonStyle" /></td>
                     </tr>
                           </table>
                        </td>
                     </tr>
                     <tr>
                       <td>&nbsp;</td>
                     </tr>
                 </table>
                 <table width="100%" border="0" cellpadding="2" cellspacing="0">
                <tr>
                 <td align="center">
                     <asp:GridView ID="gridBooking" runat="server" SkinID="gridblue"  DataKeyNames="Booking_no,Vehicle_Text,Date_From,Date_To,Status,MAgent_no,MAgent_name,PORT"
                                                        AutoGenerateColumns="False">
                                                        <PagerTemplate>
                                                            <table>
                                                                <tr>
                                                                    <td>
                                                                        <asp:ImageButton ID="ImgFirst" runat="server" CommandArgument="First" 
                                                                            CommandName="Page" Height="22px" ImageUrl="../Image/arrow-first.gif" 
                                                                            OnCommand="Paginate" />
                                                                    </td>
                                                                    <td>
                                                                        <asp:ImageButton ID="ImgBack" runat="server" Height="22px" ImageUrl="../Image/arrow-back.gif"
                                                                            OnCommand="Paginate" CommandArgument="Prev" CommandName="Page" />
                                                                    </td>
                                                                    <td valign="top">
                                                                        Page
                                                                        <asp:DropDownList ID="ddlPage" runat="server" AutoPostBack="true"
                                                                            OnSelectedIndexChanged="ddlPage_SelectedIndexChanged">
                                                                        </asp:DropDownList>
                                                                        of
                                                                        <asp:Label ID="lbPageCount" runat="server" Text="Label"></asp:Label>
                                                                    </td>
                                                                    <td>
                                                                        <asp:ImageButton ID="ImgNext" runat="server" Height="22px" ImageUrl="../Image/arrow-next.gif"
                                                                            OnCommand="Paginate" CommandArgument="Next" CommandName="Page" />
                                                                    </td>
                                                                    <td>
                                                                        <asp:ImageButton ID="ImgEnd" runat="server" Height="22px" ImageUrl="../Image/arrow-end.gif"
                                                                            OnCommand="Paginate" CommandArgument="Last" CommandName="Page" />
                                                                    </td>
                                                                </tr>
                                                            </table>
                                                        </PagerTemplate>
                                                        <Columns>
                                                            <asp:BoundField HeaderText="BOOKING NO." DataField="Booking_no" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="80px" />
                                                             <asp:TemplateField HeaderText="BOOKING NO."  ItemStyle-Width="80px" ItemStyle-Wrap="false" Visible="false" >
                                                                <ItemTemplate>
                                                                  <asp:LinkButton ID="LinkBooking" runat="server" Text="<%# Bind('Booking_no') %>" CommandArgument="<%# Container.DataItemIndex %>" CommandName="AddData"></asp:LinkButton>
                                                                </ItemTemplate>
                                                            </asp:TemplateField>
                                                            <asp:BoundField HeaderText="VESSEL NAME" DataField="Vehicle_Text" />
                                                            <asp:BoundField HeaderText="LAY CAN" ItemStyle-HorizontalAlign="left" ItemStyle-Width="100px" />
                                                            <asp:TemplateField HeaderText="BOOKING" ItemStyle-Width="90px">
                                                                <ItemTemplate>
                                                                    <asp:ImageButton ID="imgBooking" CommandName="Booking" CommandArgument="<%# Container.DataItemIndex %>"  runat="server" />
                                                                </ItemTemplate>
                                                            </asp:TemplateField>
                                                            <asp:TemplateField HeaderText="ESTIMATE" ItemStyle-Width="60px">
                                                                <ItemTemplate>
                                                                    <asp:ImageButton ID="imgEstimate" CommandName="Estimate" CommandArgument="<%# Container.DataItemIndex %>"  runat="server" />
                                                                </ItemTemplate>
                                                            </asp:TemplateField>
                                                            <asp:TemplateField HeaderText="PAYMENT" ItemStyle-Width="40px">
                                                                <ItemTemplate>
                                                                    <asp:ImageButton ID="imgPayment" CommandName="Payment" CommandArgument="<%# Container.DataItemIndex %>"  runat="server" />
                                                                </ItemTemplate>
                                                            </asp:TemplateField>
                                                        </Columns>
                                                        <HeaderStyle CssClass="gvHeaderRow" ForeColor="White" HorizontalAlign="Center" VerticalAlign="Middle" Wrap="False" />
                                                    </asp:GridView>
                                                    <asp:Label ID="lbAlert" runat="server" Font-Names="Tahoma" Style="color: Red; font-size: 16px;"
                                                        Visible="False"></asp:Label>
                       </td>
                </tr>
                <tr>
                   <td style="height:5px;"><img src="../Image/space.gif" /></td>
                </tr>
                <tr>
                  <td>
                     <table width="95%" border="0" cellpadding="0" cellspacing="0" >
                        <tr>
                          <td>&nbsp;</td>
                          <td style="width:150px;">
                             <fieldset>
                                   <table width="100%" border="0" cellpadding="2" cellspacing="0">
                                     <tr>
                                       <td><img src="../Image/NotCorrect.png" title="Not Start />&nbsp;&nbsp;<asp:Label ID="notstart" runat="server" SkinID="lbtxt" Text=" = Not Start"></asp:Label></td>
                                     </tr>
                                     <tr>
                                        <td><img src="../Image/Yellow.png" title="Not Start />&nbsp;&nbsp;<asp:Label ID="Label1" runat="server" SkinID="lbtxt" Text=" = On Processing"></asp:Label></td>
                                     </tr>
                                     <tr>
                                        <td><img src="../Image/Correct.png" title="Not Start />&nbsp;&nbsp;<asp:Label ID="Label2" runat="server" SkinID="lbtxt" Text=" = Finish"></asp:Label></td>
                                     </tr>
                                   </table>
                             </fieldset>
                          </td>
                        </tr>
                     </table>
                  </td>
                </tr>
                </table>
                </asp:Panel>
                <asp:Panel ID="PanelSub" runat="server">
                 <table width="100%" border="0" cellpadding="2" cellspacing="0">
                <tr>
                 <td align="center">
                     <asp:GridView ID="gridsub" runat="server" SkinID="gridblue"  DataKeyNames="Booking_no,Vehicle_Text,Date_From,Date_To,Status,MAgent_no,MAgent_name,PORT"
                                                        AutoGenerateColumns="False">
                                                        <PagerTemplate>
                                                            <table>
                                                                <tr>
                                                                    <td>
                                                                        <asp:ImageButton ID="ImgFirst" runat="server" CommandArgument="First" 
                                                                            CommandName="Page" Height="22px" ImageUrl="../Image/arrow-first.gif" 
                                                                            OnCommand="Paginate" />
                                                                    </td>
                                                                    <td>
                                                                        <asp:ImageButton ID="ImgBack" runat="server" Height="22px" ImageUrl="../Image/arrow-back.gif"
                                                                            OnCommand="Paginate" CommandArgument="Prev" CommandName="Page" />
                                                                    </td>
                                                                    <td valign="top">
                                                                        Page
                                                                        <asp:DropDownList ID="ddlPage" runat="server" AutoPostBack="true"
                                                                            OnSelectedIndexChanged="ddlPage_SelectedIndexChanged">
                                                                        </asp:DropDownList>
                                                                        of
                                                                        <asp:Label ID="lbPageCount" runat="server" Text="Label"></asp:Label>
                                                                    </td>
                                                                    <td>
                                                                        <asp:ImageButton ID="ImgNext" runat="server" Height="22px" ImageUrl="../Image/arrow-next.gif"
                                                                            OnCommand="Paginate" CommandArgument="Next" CommandName="Page" />
                                                                    </td>
                                                                    <td>
                                                                        <asp:ImageButton ID="ImgEnd" runat="server" Height="22px" ImageUrl="../Image/arrow-end.gif"
                                                                            OnCommand="Paginate" CommandArgument="Last" CommandName="Page" />
                                                                    </td>
                                                                </tr>
                                                            </table>
                                                        </PagerTemplate>
                                                        <Columns>
                                                            <asp:BoundField HeaderText="BOOKING NO." DataField="Booking_no" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="80px" />
                                                            <asp:BoundField HeaderText="VESSEL NAME" DataField="Vehicle_Text" />
                                                            <asp:BoundField HeaderText="LAY CAN" ItemStyle-HorizontalAlign="left" ItemStyle-Width="100px" />
                                                            <asp:TemplateField HeaderText="BOOKING" ItemStyle-Width="90px">
                                                                <ItemTemplate>
                                                                    <asp:ImageButton ID="imgBooking" CommandName="Booking" CommandArgument="<%# Container.DataItemIndex %>"  runat="server" />
                                                                </ItemTemplate>
                                                            </asp:TemplateField>
                                                            <asp:TemplateField HeaderText="ESTIMATE" ItemStyle-Width="60px">
                                                                <ItemTemplate>
                                                                    <asp:ImageButton ID="imgEstimate" CommandName="Estimate" CommandArgument="<%# Container.DataItemIndex %>"  runat="server" />
                                                                </ItemTemplate>
                                                            </asp:TemplateField>
                                                            <asp:TemplateField HeaderText="PAYMENT" ItemStyle-Width="40px">
                                                                <ItemTemplate>
                                                                    <asp:ImageButton ID="imgPayment" CommandName="Payment" CommandArgument="<%# Container.DataItemIndex %>"  runat="server" />
                                                                </ItemTemplate>
                                                            </asp:TemplateField>
                                                        </Columns>
                                                        <HeaderStyle CssClass="gvHeaderRow" ForeColor="White" HorizontalAlign="Center" VerticalAlign="Middle" Wrap="False" />
                                                    </asp:GridView>
                                                    <asp:Label ID="Label3" runat="server" Font-Names="Tahoma" Style="color: Red; font-size: 16px;"
                                                        Visible="False"></asp:Label>
                       </td>
                </tr>
                <tr>
                   <td style="height:5px;"><img src="../Image/space.gif" /></td>
                </tr>
                <tr>
                   <td>
                       <table width="95%" border="0" cellpadding="0" cellspacing="0">
                          <tr>
                           <td>
                          <fieldset>
                             <asp:Panel ID="panelBooking" runat="server" Visible="false" >
                                 <table width="100%" border="0" cellpadding="2" cellspacing="0">
                                       <tr>
                                          <td colspan="2" align="right" >
                                              <asp:ImageButton ID="imgCloseBOoking" runat="server" OnClick="imgCloseActual_Click" ImageUrl="~/Image/4090.png" />
                                          </td>
                                       </tr>
                                       <tr>
                                          <td align="right" style="width:220px;"><asp:Label ID="lbBosdfa" runat="server"  SkinID="lbtxt" Text="Booking No. :" ></asp:Label>&nbsp;</td>
                                          <td align="left"><asp:Label ID="lbBooking"  SkinID="lbtxt" runat="server" Text="" ></asp:Label></td>
                                       </tr>
                                       <tr>
                                          <td align="right" style="width:220px;"><asp:Label ID="Label5" runat="server"  SkinID="lbtxt" Text="Sold To :" ></asp:Label>&nbsp;</td>
                                          <td align="left"><asp:Label ID="lbSoldTo"  SkinID="lbtxt" runat="server" Text="" ></asp:Label></td>
                                       </tr>
                                       <tr>
                                          <td align="right" style="width:220px;"><asp:Label ID="Label6" runat="server"  SkinID="lbtxt" Text="Vessel :" ></asp:Label>&nbsp;</td>
                                          <td align="left"><asp:Label ID="lbVessel"  SkinID="lbtxt" runat="server" Text="" ></asp:Label></td>
                                       </tr>
                                       <tr>
                                          <td align="right" style="width:220px;"><asp:Label ID="Label7" runat="server"  SkinID="lbtxt" Text="LAY CAN/LAY DAY :" ></asp:Label>&nbsp;</td>
                                          <td align="left"><asp:Label ID="lbLaycan"  SkinID="lbtxt" runat="server" Text="" ></asp:Label></td>
                                       </tr>
                                        <tr>
                                          <td align="right" style="width:220px;"><asp:Label ID="Label44" runat="server"  SkinID="lbtxt" Text="WHARF :" ></asp:Label>&nbsp;</td>
                                          <td align="left"><asp:Label ID="lbWharfMyBOoking"  SkinID="lbtxt" runat="server" Text="" ></asp:Label></td>
                                       </tr>
                                        <tr>
                                          <td align="right" style="width:220px;"><asp:Label ID="Label23" runat="server"  SkinID="lbtxt" Text="PLAN BERTH :" ></asp:Label>&nbsp;</td>
                                          <td align="left"><asp:Label ID="lbPlan"  SkinID="lbtxt" runat="server" Text="" ></asp:Label></td>
                                       </tr>
                                       <tr>
                                          <td align="right" style="width:220px;"><asp:Label ID="Label39" runat="server"  SkinID="lbtxt" Text="PLAN DEPART :" ></asp:Label>&nbsp;</td>
                                          <td align="left"><asp:Label ID="lbDepart"  SkinID="lbtxt" runat="server" Text="" ></asp:Label></td>
                                       </tr>
                                       <tr>
                                          <td align="right" valign="top" style="width:220px;"><asp:Label ID="Label8" runat="server" SkinID="lbtxt" Text="Product :" ></asp:Label>&nbsp;</td>
                                          <td align="left">
                                            <asp:GridView ID="gridProduct" runat="server" SkinID="gridblueNoPage" DataKeyNames="Product_no,Product_name,Product_Event,Group_no,Product_BUYER_no,Product_SELLER_no,Product_Unit"
                     AutoGenerateColumns="False">
                     <Columns>
                         <asp:BoundField HeaderText="Operation" DataField="Product_Event" />
                         <asp:BoundField HeaderText="Product Group" DataField="Group_name" />
                         <asp:BoundField HeaderText="Product" DataField="Product_name"/>
                         <asp:BoundField HeaderText="Amount" DataField="Product_Amount" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="80px" />
                         <asp:BoundField HeaderText="Unit" DataField="Product_Unit" />
                         <asp:BoundField HeaderText="BUYER" DataField="Product_BUYER_name" />
                         <asp:BoundField HeaderText="SELLER" DataField="Product_SELLER_name" />
                         <asp:BoundField HeaderText="เจ้าของสินค้า" DataField="Owner_Product_name" Visible="false" />
                         <asp:BoundField HeaderText="Destination" DataField="DestinationShow" />
                         <asp:BoundField HeaderText="Detail" DataField="Product_Description"/>
                     </Columns>
                 </asp:GridView>
                                          </td>
                                       </tr>
                                       <tr>
                                         <td colspan="2" align="center" >
                                           <asp:ImageButton ID="imgSendMail" runat="server" ToolTip="Send Mail" ImageUrl="~/Image/mail2.png" />
                                         </td>
                                       </tr>
                                 </table>
                             </asp:Panel>
                             <asp:Panel ID="panelEstimate" runat="server" Visible="false">
                                <table width="100%" border="0" cellpadding="2" cellspacing="0">
                                       <tr>
                                          <td colspan="2" align="right" >
                                              <asp:ImageButton ID="imgCloseActual" runat="server" ImageUrl="~/Image/4090.png" />
                                          </td>
                                       </tr>
                                       <tr>
                                          <td align="center">
                                              <asp:Label ID="lbHead" runat="server" SkinID="lbHeadReport" Text="IRPC PUBLIC CO.,LTD."></asp:Label>
                                          </td>
                                       </tr>
                                       <tr>
                                          <td align="center">
                                              <asp:Label ID="lbHead2" runat="server" SkinID="lbHeadReport" Text="SUMMARY PORT TARIFF EXPENSE"></asp:Label>
                                          </td>
                                       </tr>
                                       <tr>
                                          <td align="center">
                                              <asp:Label ID="Label4" runat="server" SkinID="lbHeadReport" Text="ESTIMATE"></asp:Label>
                                          </td>
                                       </tr>
                                       <tr>
                                         <td align="center">
                                           <table width="95%" border="0" cellpadding="0" cellspacing="0">
                                              <tr>
                                                 <td align="left"><asp:Label ID="lbShip" runat="server" SkinID="lbtxt" ></asp:Label></td>
                                                 <td align="center"><asp:Label ID="lbPilottime" runat="server" SkinID="lbtxt" ></asp:Label></td>
                                                 <td align="right"><asp:Label ID="lbLayTime" runat="server" SkinID="lbtxt" ></asp:Label></td>
                                                 
                                              </tr>
                                           </table>
                                         </td>
                                       </tr>
                                        <tr>
                                         <td align="center">
                                           <table width="95%" border="0" cellpadding="0" cellspacing="0">
                                              <tr>
                                                <td align="left"><asp:Label ID="lbAgent" runat="server" SkinID="lbtxt" ></asp:Label></td>
                                                <td align="center"><asp:Label ID="lbPo" runat="server" SkinID="lbtxt" ></asp:Label></td>
                                                 <td align="right"><asp:Label ID="lbWharf" runat="server" SkinID="lbtxt" ></asp:Label></td>
                                              </tr>
                                           </table>
                                         </td>
                                       </tr>
                                       <tr>
                                         <td align="center">
                                           <table width="95%" border="0" cellpadding="0" cellspacing="0">
                                              <tr>
                                                 <td align="left"><asp:Label ID="lbLoA" runat="server" SkinID="lbtxt" ></asp:Label></td>
                                                 <td align="center"><asp:Label ID="lbGrt" runat="server" SkinID="lbtxt" ></asp:Label></td>
                                                 <td align="right"><asp:Label ID="lbdWT" runat="server" SkinID="lbtxt" ></asp:Label></td>                                                 
                                              </tr>
                                           </table>
                                         </td>
                                       </tr>
                                       <tr>
                                          <td align="center">
                                            <asp:Literal ID="LiEstimate" runat="server" ></asp:Literal>
                                          </td>
                                       </tr>
                                       <tr>
                                         <td align="center">
                                              <asp:ImageButton ID="btnPrint" ToolTip="Print" runat="server" ImageUrl="~/Image/printer.png" />&nbsp;&nbsp;&nbsp;
                                              <asp:ImageButton ID="btnSendMailActual" ToolTip="Send Mail" runat="server" ImageUrl="~/Image/mail2.png" />
                                         </td>
                                       </tr>
                                 </table>
                             </asp:Panel>
                          </fieldset>
                          </td>
                        </tr>
                      </table>
                   </td>
                </tr>
                <tr>
                   <td style="height:5px;"><img src="../Image/space.gif" /></td>
                </tr>
                </table>
                </asp:Panel>
                <asp:Panel ID="PanelAdd" runat="server" Visible="false">
                <table width="100%" border="0" cellpadding="2" cellspacing="0">
                                       <tr>
                                          <td colspan="2" align="right" >
                                              <asp:ImageButton ID="ImageButton1" runat="server" OnClick="imgCloseActual_Click" ImageUrl="~/Image/4090.png" />
                                          </td>
                                       </tr>
                                       <tr>
             <td style="width:220px;" align="right"><asp:Label ID="labelRed" runat="server" Text="*" ForeColor="Red" ></asp:Label><asp:Label ID="Label24" runat="server" SkinID="lbtxt" Text="TERMINAL :"></asp:Label>&nbsp;</td>
             <td align="left">
                 <asp:RadioButtonList ID="radioPort" runat="server" SkinID="raio" RepeatDirection="Horizontal">
                    <asp:ListItem Value="L">Liquid</asp:ListItem>
                    <asp:ListItem Value="B">Bulk</asp:ListItem>
                 </asp:RadioButtonList>
             </td>
           </tr>
           <tr>
             <td style="width:220px;" align="right"><asp:Label ID="lbID" runat="server" SkinID="lbtxt" Text="Main Agent(SoldTo) :"></asp:Label>&nbsp;</td>
             <td align="left"><asp:TextBox ID="txtid" runat="server" Width="350px"></asp:TextBox>
               <asp:AutoCompleteExtender  runat="server" ID="AutoCompleteExtender1" BehaviorID="AutoCompleteEx2" CompletionInterval="50"
                     TargetControlID="txtid" ServicePath="../WebService/AutoComplete_IPORT.asmx" MinimumPrefixLength="1" 
                    ServiceMethod="GetCustomer" CompletionListCssClass="autocomplete_completionListElement"
                CompletionListItemCssClass="autocomplete_listItem"
                CompletionListHighlightedItemCssClass="autocomplete_highlightedListItem" >
                <Animations>
                    <OnShow>
                        <Sequence>
                            <%-- Make the completion list transparent and then show it --%>
                            <OpacityAction Opacity="0" />
                            <HideAction Visible="true" />
                            
                            <%--Cache the original size of the completion list the first time
                                the animation is played and then set it to zero --%>
                            <ScriptAction Script="
                                // Cache the size and setup the initial size
                                var behavior = $find('AutoCompleteEx2');
                                if (!behavior._height) {
                                    var target = behavior.get_completionList();
                                    behavior._height = target.offsetHeight - 2;
                                    target.style.height = '0px';
                                }" />
                            
                            <%-- Expand from 0px to the appropriate size while fading in --%>
                            <Parallel Duration=".3">
                                <FadeIn />
                                <Length PropertyKey="height" StartValue="0" EndValueScript="$find('AutoCompleteEx2')._height" />
                            </Parallel>
                        </Sequence>
                    </OnShow>
                    <OnHide>
                        <%-- Collapse down to 0px and fade out --%>
                        <Parallel Duration=".3">
                            <FadeOut />
                            <Length PropertyKey="height" StartValueScript="$find('AutoCompleteEx2')._height" EndValue="0" />
                        </Parallel>
                    </OnHide>
                </Animations>
                 </asp:AutoCompleteExtender>
             </td>
           </tr>
           <tr>
             <td style="width:220px;" align="right"><asp:Label ID="Label28" runat="server" SkinID="lbtxt" Text="Sub Agent(ผู้ดำเนินการแทน) :"></asp:Label>&nbsp;</td>
             <td align="left"><asp:TextBox ID="txtAgent" runat="server" Width="350px"></asp:TextBox>
               <asp:AutoCompleteExtender  runat="server" ID="AutoCompleteExtender2" BehaviorID="AutoCompleteEx4" CompletionInterval="50"
                     TargetControlID="txtAgent" ServicePath="../WebService/AutoComplete_IPORT.asmx" MinimumPrefixLength="1" 
                    ServiceMethod="GetCustomer" CompletionListCssClass="autocomplete_completionListElement"
                CompletionListItemCssClass="autocomplete_listItem" 
                CompletionListHighlightedItemCssClass="autocomplete_highlightedListItem" >
                <Animations>
                    <OnShow>
                        <Sequence>
                            <%-- Make the completion list transparent and then show it --%>
                            <OpacityAction Opacity="0" />
                            <HideAction Visible="true" />
                            
                            <%--Cache the original size of the completion list the first time
                                the animation is played and then set it to zero --%>
                            <ScriptAction Script="
                                // Cache the size and setup the initial size
                                var behavior = $find('AutoCompleteEx4');
                                if (!behavior._height) {
                                    var target = behavior.get_completionList();
                                    behavior._height = target.offsetHeight - 2;
                                    target.style.height = '0px';
                                }" />
                            
                            <%-- Expand from 0px to the appropriate size while fading in --%>
                            <Parallel Duration=".3">
                                <FadeIn />
                                <Length PropertyKey="height" StartValue="0" EndValueScript="$find('AutoCompleteEx4')._height" />
                            </Parallel>
                        </Sequence>
                    </OnShow>
                    <OnHide>
                        <%-- Collapse down to 0px and fade out --%>
                        <Parallel Duration=".3">
                            <FadeOut />
                            <Length PropertyKey="height" StartValueScript="$find('AutoCompleteEx4')._height" EndValue="0" />
                        </Parallel>
                    </OnHide>
                </Animations>
                 </asp:AutoCompleteExtender>
             </td>
           </tr>
           <tr>
             <td style="width:220px;" align="right" valign="top"><asp:Label ID="label46" runat="server" Text="*" ForeColor="Red" ></asp:Label><asp:Label ID="Label9" runat="server" SkinID="lbtxt" Text="SHIP NAME :"></asp:Label>&nbsp;</td>
             <td align="left">
              <asp:Panel ID="PanelVEHICLE_IN" runat="server">
                  <asp:TextBox ID="txtVessel" runat="server"  Width="350px"></asp:TextBox>&nbsp;<asp:Button ID="btnSearch" runat="server" Text="Select" CssClass="ButtonStyle" />
                 <asp:AutoCompleteExtender  runat="server" ID="autoComplete1" BehaviorID="AutoCompleteEx" CompletionInterval="50"
                     TargetControlID="txtVessel" ServicePath="../WebService/AutoComplete_IPORT.asmx" MinimumPrefixLength="1" 
                    ServiceMethod="GetVessel" CompletionListCssClass="autocomplete_completionListElement"
                CompletionListItemCssClass="autocomplete_listItem" 
                CompletionListHighlightedItemCssClass="autocomplete_highlightedListItem" >
                <Animations>
                    <OnShow>
                        <Sequence>
                            <%-- Make the completion list transparent and then show it --%>
                            <OpacityAction Opacity="0" />
                            <HideAction Visible="true" />
                            
                            <%--Cache the original size of the completion list the first time
                                the animation is played and then set it to zero --%>
                            <ScriptAction Script="
                                // Cache the size and setup the initial size
                                var behavior = $find('AutoCompleteEx');
                                if (!behavior._height) {
                                    var target = behavior.get_completionList();
                                    behavior._height = target.offsetHeight - 2;
                                    target.style.height = '0px';
                                }" />
                            
                            <%-- Expand from 0px to the appropriate size while fading in --%>
                            <Parallel Duration=".3">
                                <FadeIn />
                                <Length PropertyKey="height" StartValue="0" EndValueScript="$find('AutoCompleteEx')._height" />
                            </Parallel>
                        </Sequence>
                    </OnShow>
                    <OnHide>
                        <%-- Collapse down to 0px and fade out --%>
                        <Parallel Duration=".3">
                            <FadeOut />
                            <Length PropertyKey="height" StartValueScript="$find('AutoCompleteEx')._height" EndValue="0" />
                        </Parallel>
                    </OnHide>
                </Animations>
                 </asp:AutoCompleteExtender>
              </asp:Panel>
              <asp:Panel ID="PanelVEHICLE_OUT" runat="server" Visible="false">
              <table width="100%" border="0" cellpadding="0" cellspacing="0">
                            <tr>
                               <td>
                                    <asp:TextBox ID="txtVesselOUT" runat="server"  Width="350px"></asp:TextBox>&nbsp;<asp:Button ID="btnSearchOUT" runat="server" Text="Select" CssClass="ButtonStyle" />
                                 </td>
                            </tr>
                           <tr>
                              <td align="left">
                                  <table width="100%" border="0" cellpadding="2" cellspacing="0">
                                       <tr>
                                          <td style="width:60px;" align="right"><asp:Label ID="Label10" runat="server" SkinID="lbtxt" Text="L.O.A :"></asp:Label></td>
                                          <td style="width:220px;" align="left"> <asp:TextBox ID="txtLOA" runat="server" Width="140px" onkeypress="return checkNumber(this);"></asp:TextBox>&nbsp;<asp:Label ID="lbFT1" runat="server" SkinID="lbtxt" Text="FT"></asp:Label></td>
                                          <td style="width:90px;" align="right"><asp:Label ID="Label11" runat="server" SkinID="lbtxt" Text="DWT :"></asp:Label></td>
                                          <td style="width:220px;" align="left"> <asp:TextBox ID="txtDWT" runat="server" Width="140px" onkeypress="return checkNumber(this);"></asp:TextBox>&nbsp;<asp:Label ID="Label19ee" runat="server" SkinID="lbtxt" Text="MT"></asp:Label></td>
                                          <td>&nbsp;</td>
                                       </tr>
                                       <tr>
                                          <td style="width:60px;" align="right"><asp:Label ID="Label12" runat="server" SkinID="lbtxt" Text="Draft :"></asp:Label></td>
                                          <td style="width:220px;" align="left"> <asp:TextBox ID="txtDraft" runat="server" Width="140px" onkeypress="return checkNumber(this);"></asp:TextBox>&nbsp;<asp:Label ID="lbFT2" runat="server" SkinID="lbtxt" Text="FT"></asp:Label></td>
                                          <td style="width:90px;" align="right"><asp:Label ID="Label13" runat="server" SkinID="lbtxt" Text="GRT :"></asp:Label></td>
                                          <td style="width:220px;" align="left"> <asp:TextBox ID="txtGRT" runat="server" Width="140px" onkeypress="return checkNumber(this);"></asp:TextBox>&nbsp;<asp:Label ID="Label23ww" runat="server" SkinID="lbtxt" Text="MT"></asp:Label></td>
                                          <td>&nbsp;</td>
                                       </tr>
                                       <tr>
                                          <td style="width:60px;" align="right"><asp:Label ID="Label25" runat="server" SkinID="lbtxt" Text="FLAG :"></asp:Label></td>
                                          <td style="width:220px;" align="left">
                                              <asp:DropDownList ID="ddlNation" runat="server" SkinID="ddl" >
                                                 <asp:ListItem Value="T">THAI</asp:ListItem>
                                                 <asp:ListItem Value="O">OTHER</asp:ListItem>
                                              </asp:DropDownList>
                                          </td>
                                          <td colspan="3">&nbsp;</td>
                                       </tr>
                                  </table>
                                 </td>
                             </tr>
                </table>
              </asp:Panel>
              <asp:Panel ID="PanelVEHICLE_IN_DETAIL" runat="server" Visible="false">
              <table width="100%" border="0" cellpadding="2" cellspacing="0">
                                       <tr>
                                          <td style="width:60px;" align="right"><asp:Label ID="Label14" runat="server" SkinID="lbtxt" Text="L.O.A :"></asp:Label></td>
                                          <td style="width:220px;" align="left"><asp:Label ID="lbLOASHOW" runat="server" SkinID="lbtxt" Text="0"></asp:Label>&nbsp;<asp:Label ID="Label16" runat="server" SkinID="lbtxt" Text="FT"></asp:Label></td>
                                          <td style="width:90px;" align="right"><asp:Label ID="Label17" runat="server" SkinID="lbtxt" Text="DWT :"></asp:Label></td>
                                          <td style="width:220px;" align="left"><asp:Label ID="lbDWTSHow" runat="server" SkinID="lbtxt" Text="0"></asp:Label>&nbsp;<asp:Label ID="Label19" runat="server" SkinID="lbtxt" Text="FT"></asp:Label></td>
                                          <td>&nbsp;</td>
                                       </tr>
                                       <tr>
                                          <td style="width:60px;" align="right"><asp:Label ID="Label20" runat="server" SkinID="lbtxt" Text="Draft :"></asp:Label></td>
                                          <td style="width:220px;" align="left"><asp:Label ID="lbDraft" runat="server" SkinID="lbtxt" Text="0"></asp:Label>&nbsp;<asp:Label ID="Label21" runat="server" SkinID="lbtxt" Text="FT"></asp:Label></td>
                                          <td style="width:90px;" align="right"><asp:Label ID="Label22" runat="server" SkinID="lbtxt" Text="GRT :"></asp:Label></td>
                                          <td style="width:220px;" align="left"><asp:Label ID="lbGRTSHow" runat="server" SkinID="lbtxt" Text="0"></asp:Label>&nbsp;<asp:Label ID="Label25ee" runat="server" SkinID="lbtxt" Text="MT"></asp:Label></td>
                                          <td>&nbsp;</td>
                                       </tr>
                                       <tr>
                                          <td style="width:60px;" align="right"><asp:Label ID="Label27" runat="server" SkinID="lbtxt" Text="Nationality :"></asp:Label></td>
                                          <td style="width:220px;" align="left"><asp:Label ID="lbNation" runat="server" SkinID="lbtxt"></asp:Label></td>
                                          <td colspan="3">&nbsp;</td>
                                       </tr>
                                  </table>
              </asp:Panel>
             </td>
           </tr>
           <tr>
             <td style="width:220px;" align="right"><asp:Label ID="Label26" runat="server" SkinID="lbtxt" Text="SHIP MASTER :"></asp:Label>&nbsp;</td>
             <td align="left">
                 <asp:RadioButtonList ID="radioVehicle" runat="server" SkinID="raio" RepeatDirection="Horizontal" AutoPostBack="true">
                    <asp:ListItem Selected="True" Value="0">IN RECORD</asp:ListItem>
                    <asp:ListItem Value="1">OFF RECORD</asp:ListItem>
                 </asp:RadioButtonList>
             </td>
           </tr>
           <tr>
             <td style="width:220px;" align="right"><asp:Label ID="Label29" runat="server" SkinID="lbtxt" Text="Lay Can/Lay Day :"></asp:Label>&nbsp;</td>
             <td align="left"><asp:TextBox ID="txtDate" runat="server" Width="80px" onkeypress="return false;" ></asp:TextBox>&nbsp;<asp:ImageButton ID="ImgDate" runat="server" ImageUrl="~/Image/calendar.png" />&nbsp;<asp:Label ID="Label30" runat="server" SkinID="lbtxt" Text="TO"></asp:Label>&nbsp;<asp:TextBox ID="txtDateTo" runat="server" Width="80px"  onkeypress="return false;" ></asp:TextBox>&nbsp;<asp:ImageButton ID="ImgDateTo" runat="server"  ImageUrl="~/Image/calendar.png" />
                 <asp:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="txtDate" Format="dd MMM yyyy" PopupButtonID="ImgDate"></asp:CalendarExtender>
                 <asp:CalendarExtender ID="CalendarExtender2" runat="server" TargetControlID="txtDateTo" Format="dd MMM yyyy" PopupButtonID="ImgDateTo" ></asp:CalendarExtender>
             </td>
           </tr>
           <tr>
             <td style="width:220px;" align="right"><asp:Label ID="Label48" runat="server" SkinID="lbtxt" Text="REQUIRE DATE/TIME:"></asp:Label>&nbsp;</td>
             <td align="left">
                <asp:TextBox ID="txtDateBooking" runat="server" Width="80px" onkeypress="return false;" ></asp:TextBox>&nbsp;<asp:ImageButton ID="ImgDateBooking" runat="server" ImageUrl="~/Image/calendar.png" />&nbsp;<asp:TextBox ID="txtTimeBooking" runat="server" Width="40px"></asp:TextBox>
             <asp:CalendarExtender ID="CalendarExtender3" runat="server" TargetControlID="txtDateBooking" Format="dd MMM yyyy" PopupButtonID="ImgDateBooking"></asp:CalendarExtender>
             <asp:MaskedEditExtender ID="MaskedEditExtender3" runat="server" TargetControlID="txtTimeBooking"
                  Mask="99:99" MaskType="Time" AcceptNegative="Left" InputDirection="LeftToRight"></asp:MaskedEditExtender>
             </td>
           </tr>
           <tr>
             <td style="width:220px;" align="right"><asp:Label ID="label54" runat="server" Text="*" ForeColor="Red" ></asp:Label><asp:Label ID="Label55" runat="server" SkinID="lbtxt" Text="Demurrage :"></asp:Label>&nbsp;</td>
             <td align="left">
                 <asp:RadioButtonList ID="radioDemurrage" runat="server" AutoPostBack="true" SkinID="raio" RepeatDirection="Horizontal" >
                    <asp:ListItem Value="Y">Yes</asp:ListItem>
                    <asp:ListItem Selected="True" Value="N">No</asp:ListItem>
                 </asp:RadioButtonList>
             </td>
           </tr>
           </table>
           <table width="100%" border="0" cellpadding="2" cellspacing="0">
           <tr id="rowLaytime" runat="server" visible="false">
            <td colspan="2">
               <table width="100%" border="0" cellpadding="2" cellspacing="0" >
                   <tr>
                    <td style="width:220px;" align="right">
                        <asp:Label ID="Label45" runat="server" SkinID="lbtxt" Text="Lay Time :"></asp:Label>&nbsp;</td>
                      <td align="left">
                 <asp:TextBox ID="txtLayTime" runat="server" Width="40px" Text="0" ></asp:TextBox>&nbsp;<asp:Label ID="Label31" runat="server" SkinID="lbtxt" Text="Hours" ></asp:Label>
                   </td>
           </tr>
            <tr>
                 <td style="width:220px;" align="right"><asp:Label ID="Label52" runat="server" 
                     SkinID="lbtxt" Text="Demurrage :"></asp:Label>&nbsp;</td>
             <td align="left">
                  <asp:TextBox ID="txtDemurrage" runat="server" Text="0" MaxLength="50" onkeypress="tryNumberFormat(this);"   ></asp:TextBox>&nbsp;<asp:DropDownList ID="ddlDemurrage" runat="server" SkinID="raio" RepeatDirection="Horizontal" >
                           <asp:ListItem Value="B">BAHT</asp:ListItem>
                           <asp:ListItem Value="U">USD</asp:ListItem>
                  </asp:DropDownList>&nbsp;<asp:Label ID="lbPDPR" Text="PDPR" runat="server" SkinID="lbtxt" ></asp:Label>
             </td> 
                  </tr>
               </table>
            </td>
           </tr>
                  </table>
                   <table width="100%" border="0" cellpadding="2" cellspacing="0">
                      <tr>
                              <td style="width:220px;" align="right">&nbsp;</td>
                           <td align="left">
                           <asp:Button ID="btnSaveProduct" runat="server" Text="xx" style="display:none;" />
                           <asp:Button ID="btnProduct" runat="server" Text="ADD PRODUCT" CssClass="ButtonStyle" /></td>
                      </tr>
                      <tr>
                            <td style="width:220px;" align="right">&nbsp;</td>
                              <td align="left">
                                 <table width="90%" border="0" cellpadding="0" cellspacing="0">
                                  <tr>
                                     <td>
                               <asp:GridView ID="gridProductShow" runat="server" SkinID="gridblueNoPage" DataKeyNames="Product_no,Product_name,Product_Event,Group_no,Product_BUYER_no,Product_SELLER_no,Product_Unit"
                     AutoGenerateColumns="False">
                     <Columns>
                         <asp:BoundField HeaderText="Operation" DataField="Product_Event" />
                         <asp:BoundField HeaderText="Product Group" DataField="Group_name" />
                         <asp:BoundField HeaderText="Product" DataField="Product_name"/>
                         <asp:BoundField HeaderText="Amount" DataField="Product_Amount" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="80px" />
                         <asp:BoundField HeaderText="Unit" DataField="Product_Unit" />
                         <asp:BoundField HeaderText="BUYER" DataField="Product_BUYER_name" />
                         <asp:BoundField HeaderText="SELLER" DataField="Product_SELLER_name" />
                         <asp:BoundField HeaderText="เจ้าของสินค้า" DataField="Owner_Product_name" Visible="false" />
                         <asp:BoundField HeaderText="Destination" DataField="DestinationShow" />
                         <asp:BoundField HeaderText="Detail" DataField="Product_Description"/>
                         <asp:TemplateField HeaderText="Edit" ItemStyle-Width="50px">
                             <ItemTemplate>
                                 <asp:ImageButton ID="imgedit" CommandName="cmdedit" CommandArgument="<%# Container.DataItemIndex %>" OnClientClick="showproduct()" runat="server" ImageUrl="~/Image/edit-24.gif" />
                             </ItemTemplate>
                         </asp:TemplateField>
                          <asp:TemplateField HeaderText="Delete" ItemStyle-Width="50px" ItemStyle-HorizontalAlign="Center">
                            <ItemTemplate>
                                 <asp:ImageButton ID="imgdelete" CommandName="cmddelete" CommandArgument="<%# Container.DataItemIndex %>" OnClientClick="showConfirm(this); return false;"  runat="server" ImageUrl="~/Image/cancel-24.gif" />
                             </ItemTemplate>
                         </asp:TemplateField>
                     </Columns>
                 </asp:GridView>
                      </td>
                   </tr>
                </table>
               
             </td>
           </tr>
                  </table>
                  <table width="100%" border="0" cellpadding="0" cellspacing="0">
                      <tr>
              <td colspan="2">
                 <asp:UpdatePanel ID="PanelBunker" runat="server" UpdateMode="Conditional" >
                 <ContentTemplate>
                     <table width="100%" border="0" cellpadding="2" cellspacing="0">
                               <tr>
             <td style="width:220px;" align="right"><asp:Label ID="label32" runat="server" Text="*" ForeColor="Red" ></asp:Label><asp:Label ID="lbType" runat="server" SkinID="lbtxt" Text="Destination :"></asp:Label>&nbsp;</td>
             <td align="left" colspan="5">
                 <asp:RadioButtonList ID="raioType" runat="server" SkinID="raio" AutoPostBack="true" RepeatDirection="Horizontal">
                    <asp:ListItem Selected="True" Value="I">DOMESTIC</asp:ListItem>
                    <asp:ListItem Value="O">FOREIGN</asp:ListItem>
                 </asp:RadioButtonList>
             </td>
           </tr>
           <tr id="rowTypeBuy" runat="server" visible="false">
             <td colspan="6">
               <table width="100%" border="0" cellpadding="2" cellspacing="0">
                  <tr>
                 <td style="width:220px;" align="right"><asp:Label ID="label33" runat="server" Text="*" ForeColor="Red" ></asp:Label><asp:Label ID="Label34" runat="server" 
                     SkinID="lbtxt" Text="รูปแบบการซื้อขาย :"></asp:Label>&nbsp;</td>
             <td align="left">
                  <asp:RadioButtonList ID="radioTypeBuy" runat="server" SkinID="raio" RepeatDirection="Horizontal" >
                           <asp:ListItem Value="F">FOB</asp:ListItem>
                           <asp:ListItem Value="C">CFR</asp:ListItem>
                           <asp:ListItem Value="I">CIF</asp:ListItem>
                           <asp:ListItem Value="O">อื่นๆ</asp:ListItem>
                  </asp:RadioButtonList>
             </td> 
                  </tr>
               </table>
             </td>
             
           </tr>
                        <tr>
                           <td style="width:220px;" align="right"><asp:Label ID="Label36qq" runat="server" SkinID="lbtxt" Text="Request Bunker :"></asp:Label>&nbsp;</td>
                           <td align="left" style="width:50px">
                               <asp:CheckBox ID="chkFO" runat="server" SkinID="chk" Text="FO" />
                          </td>
                          <td style="width:45px;">
                             <asp:Label ID="Label37ww" runat="server" SkinID="lbtxt" Text="AMOUNT"></asp:Label>
                          </td>
                          <td style="width:40px;">
                          <asp:TextBox ID="txtFO" runat="server" Width="35px" Text="0"  MaxLength="10" onkeypress="return checkNumber(this);" ></asp:TextBox>&nbsp<asp:Label ID="Label38" runat="server" SkinID="lbtxt" Text="UNIT"></asp:Label>
                          </td>
                          <td align="left" style="width:60px" >
                             <asp:Label ID="Label3933" runat="server" SkinID="lbtxt" Text="REMARK"></asp:Label>&nbsp;
                          </td>
                          <td rowspan="2" valign="top" align="left">
                            <asp:TextBox ID="txtBunkerDetail" runat="server" TextMode="MultiLine" Height="50px" Width="300px" ></asp:TextBox>
                          </td>
                         </tr>
                         <tr>
                           <td style="width:220px;" align="right">&nbsp;</td>
                           <td align="left">
                               <asp:CheckBox ID="chkDO" runat="server" SkinID="chk" Text="DO" />
                          </td>
                          <td style="width:45px">
                          <asp:Label ID="Label40" runat="server" SkinID="lbtxt" Text="AMOUNT"></asp:Label>
                          </td>
                          <td style="width:45px">
                            <asp:TextBox ID="txtDO" Width="35px" runat="server" Text="0" MaxLength="10" onkeypress="return checkNumber(this);" ></asp:TextBox>&nbsp;<asp:Label ID="Label41" runat="server" SkinID="lbtxt" Text="UNIT"></asp:Label>
                          </td>
                          <td></td>
                         </tr>
                     </table>
                 </ContentTemplate>
                 </asp:UpdatePanel>
              </td>
           </tr>
           <tr>
             <td colspan="2" >
                <asp:UpdatePanel ID="updatePanelWater" runat="server" UpdateMode="Conditional">
                   <ContentTemplate>
                    <table width="100%" border="0" cellpadding="2" cellspacing="0">
                     <tr>
                       <td style="width:220px;" align="right"><asp:Label ID="Label42" runat="server" SkinID="lbtxt" Text="Request Water :"></asp:Label>&nbsp;</td>
                         <td align="left">
                             <asp:TextBox ID="txtWater" Width="35px" runat="server" Text="0" MaxLength="10" onkeypress="return checkNumber(this);" ></asp:TextBox>&nbsp;<asp:Label ID="LabelWater" runat="server" SkinID="lbtxt" Text="TON" ></asp:Label>
                         </td>
                      </tr>
                      <tr>
                       <td style="width:220px;" align="right"><asp:Label ID="Label47" runat="server" SkinID="lbtxt" Text="Request Electricity :"></asp:Label>&nbsp;</td>
                         <td align="left">
                             <asp:TextBox ID="txtElectricity" Width="35px" runat="server" Text="0" MaxLength="10" onkeypress="return checkNumber(this);" ></asp:TextBox>&nbsp;<asp:Label ID="Label53" runat="server" SkinID="lbtxt" Text="KWH" ></asp:Label>
                         </td>
                      </tr>
                    </table>
                   </ContentTemplate>
                </asp:UpdatePanel>
             </td>
           </tr>
           <tr>
              <td colspan="2">
                 <table width="100%" border="0" cellpadding="2" cellspacing="0">
                     <tr>
                       <td style="width:220px;" align="right"><asp:Label ID="label50" runat="server" Text="*" ForeColor="Red" ></asp:Label><asp:Label ID="Label43" runat="server" SkinID="lbtxt" Text="ATTACHMENT :"></asp:Label>&nbsp;</td>
                         <td align="left">
                             <asp:Button ID="btnSaveUpload" runat="server" style="display:none;" />
                             <asp:Button ID="btnUpload" runat="server" Text="Upload" CssClass="ButtonStyle" />
                         </td>
                      </tr>
                      <tr>
                       <td align="right"></td>
                               <td align="left">
                                   <asp:GridView ID="gridfile" runat="server" SkinID="gridblueNoPage" DataKeyNames="File_nameGuid,File_ContentType,File_name,File_Type"
                                   AutoGenerateColumns="False">
                                    <Columns>
                                         <asp:TemplateField HeaderStyle-Wrap="false" HeaderText="File Name">
                                            <ItemTemplate>
                                                <asp:LinkButton ID="linkID" runat="server" Text="<%# Bind('File_name') %>" CommandArgument="<%# Container.DataItemIndex %>"  CommandName="Select"></asp:LinkButton>
                                                </ItemTemplate>
                                            <HeaderStyle Wrap="False" />
                                          <ItemStyle HorizontalAlign="Center" />
                                          </asp:TemplateField>
                                        <asp:BoundField HeaderText="นามสกุล" DataField="File_type" />
                                        <asp:BoundField HeaderText="Type" DataField="Upload_Type" />
                                        <asp:BoundField HeaderText="รายละเอียด" DataField="Description" />
                                        <asp:TemplateField HeaderText="ลบ" ItemStyle-Width="50px" ItemStyle-HorizontalAlign="Center">
                                        <ItemTemplate>
                                          <asp:ImageButton ID="imgdelete" CommandName="cmddelete" CommandArgument="<%# Container.DataItemIndex %>" OnClientClick="showConfirm(this); return false;"  runat="server" ImageUrl="~/Image/cancel-24.gif" />
                                        </ItemTemplate>
                                        </asp:TemplateField>
                                    </Columns>
                                  </asp:GridView>
                               </td>
                        </tr>
                 </table>
              </td>
           </tr>
            <tr>
              <td colspan="2">
                 <table width="100%" border="0" cellpadding="2" cellspacing="0">
                      <tr id="rowRemarkVPS" runat="server" visible="false" valign="top" >
                                  <td style="width:220px;" align="right"><asp:Label ID="Label35" runat="server" SkinID="lbtxt" Text="REMARK FROM VPS :"></asp:Label>&nbsp;</td>
                                 <td align="left"><asp:Label ID="lbRemark_VPS" runat="server" SkinID="lbtxt" ></asp:Label></td>
                       </tr>
                      <tr id="rowRemarkMRI" runat="server" visible="false" valign="top" >
                            <td style="width:220px;" align="right"><asp:Label ID="Label36" runat="server" SkinID="lbtxt" Text="REMARK FROM MRI :"></asp:Label>&nbsp;</td>
                            <td align="left"><asp:Label ID="lbRemark_MRI" runat="server" SkinID="lbtxt" ></asp:Label></td>
                       </tr>
                       <tr id="rowCancel" runat="server" visible="false" valign="top" >
                 <td style="width:220px;" align="right" valign="top"><asp:Label ID="Label37" runat="server" SkinID="lbtxt" Text="CAUSE CANCELLATION :"></asp:Label>&nbsp;</td>
               <td align="left"><asp:Label ID="lbCancel" runat="server" SkinID="lbtxt" ></asp:Label></td>
                     </tr>
                      <tr>
                        <td style="width:220px;" align="right" valign="top"><asp:Label ID="Label38qer" runat="server" SkinID="lbtxt" Text="REMARK :"></asp:Label>&nbsp;</td>
                        <td align="left" valign="top">
                             <asp:TextBox ID="txtRemark" runat="server" TextMode="MultiLine" Height="70px" Width="90%" ></asp:TextBox>
                          </td>
                     </tr>
                 </table>
              </td>
           </tr>
           <tr>
             <td colspan="2">
                <asp:UpdatePanel ID="UpdatePanelTariff" runat="server" UpdateMode="Conditional">
                  <ContentTemplate>
                     <table width="100%" border="0" cellpadding="2" cellspacing="0">
                        <tr>
                        <td style="width:220px;" align="right">&nbsp;</td>
                        <td align="left">
                              <asp:Button ID="btnSave" runat="server" Text="บันทึก" CssClass="ButtonStyle" />
                              <asp:Button ID="btnSaveBooking" runat="server" Text="ยืนยันการจอง" CssClass="ButtonStyle" />
                         </td>
                        </tr>
                     </table>
                  </ContentTemplate>
                </asp:UpdatePanel>
             </td>
           </tr>
           <tr id="rowGridTariff" runat="server" visible="false">
              <td colspan="2" >
                <table width="100%" border="0" cellpadding="2" cellspacing="0">
                           <tr>
                           <td colspan="2" align="center">
             <table width="100%" border="0" cellpadding="0" cellspacing="0">
                 <tr>
                              <td style="width:220px;" align="right"><asp:Label ID="lbTariff" runat="server" SkinID="lbtxt" Text="Tariff :"></asp:Label>&nbsp;</td>
             <td align="left">
                 <asp:Button ID="btnTariff" runat="server" Text="ค้นหา Tariff" CssClass="ButtonStyle" OnClientClick="showTariff('1');" />
             </td>
                 </tr>
             </table>
             </td>
           </tr>
           <tr>
             <td colspan="2" align="center">
             <table width="100%" border="0" cellpadding="0" cellspacing="0">
                <tr>
                 <asp:GridView ID="gridTariff" runat="server" SkinID="gridblueNoPage" DataKeyNames="MATERIAL,Text_line,Unit,Count,MAT_Default,KBETR,KONWA,MAT_Relation,MAT_ComputeM"
                     AutoGenerateColumns="False">
                     <Columns>
                         <asp:BoundField HeaderText="รหัส" DataField="MATERIAL"/>
                         <asp:BoundField HeaderText="ชื่อ" DataField="Text_line" ItemStyle-HorizontalAlign="Center" />
                         <asp:BoundField HeaderText="จำนวน" DataField="Count" ItemStyle-HorizontalAlign="Center"  />
                         <asp:BoundField HeaderText="หน่วย" DataField="Unit" ItemStyle-HorizontalAlign="Center"  />
                          <asp:TemplateField HeaderText="ลบ" ItemStyle-Width="50px" ItemStyle-HorizontalAlign="Center">
                            <ItemTemplate>
                                 <asp:ImageButton ID="imgdelete" CommandName="cmddelete" CommandArgument="<%# Container.DataItemIndex %>" OnClientClick="showConfirm(this); return false;"  runat="server" ImageUrl="~/Image/cancel-24.gif" />
                             </ItemTemplate>
                         </asp:TemplateField>
                     </Columns>
                 </asp:GridView>
                </tr>
             </table>
             </td>
           </tr>
                  </table>
                  </td>
                  </tr>
                  </table>
                </asp:Panel>
            </td>
          </tr>
        </table>
        <asp:Button ID="btnProductpopup" runat="server" Text="Button" style="display:none" />
        <asp:Button ID="BtnTrigger" runat="server" Text="Button" style="display:none" />
            <asp:ModalPopupExtender ID="ModalPopupExtender4" runat="server" BackgroundCssClass="Background"
     TargetControlID="btnUpload" PopupControlID="PopupUpload" >
    </asp:ModalPopupExtender>
    <asp:ModalPopupExtender ID="ModalPopupExtender5" runat="server" BackgroundCssClass="Background"
     TargetControlID="btnProductpopup" PopupControlID="PopupProduct" >
    </asp:ModalPopupExtender>
    <asp:ModalPopupExtender ID="ModalPopupExtender3" BehaviorID="ModalPopupExtender3" runat="server" 
                                    OkControlID="ctl00_contentplaceholder1_ConfirmDelete_btnOk" 
                                    OnOkScript="okClick();" 
                                    CancelControlID="ctl00_contentplaceholder1_ConfirmDelete_btnNo"     
                                    OnCancelScript="cancelClick();" 
                                     BackgroundCssClass="Background" DropShadow="false" 
                                      PopupControlID="PanelConfirm" TargetControlID="BtnTrigger" >
        </asp:ModalPopupExtender>
                    <asp:Panel ID="PopupUpload" runat="server" Style="display: none;">
        <table>
            <tr>
                <td>
                    <iframe runat="server" id="Iframe1" marginheight="0px"  class="Style-Iframe" marginwidth="0px" src="../FormPopup/UploadFile.aspx">
                    </iframe>
                </td>
            </tr>
        </table>
    </asp:Panel>
             <asp:Panel ID="PopupProduct" runat="server" Style="display: none;">
        <table>
            <tr>
                <td>
                    <iframe runat="server" id="ProductPopup" marginheight="0px"  class="Style-Iframe" marginwidth="0px" src="../FormPopup/ProductPopup.aspx">
                    </iframe>
                </td>
            </tr>
        </table>
    </asp:Panel>
    <asp:Panel ID="PanelConfirm" runat="server" style="display:none;">
       <Confirm:Confirm1 ID="ConfirmDelete" runat="server" ></Confirm:Confirm1>
    </asp:Panel>
      </ContentTemplate>
   </asp:UpdatePanel>
</asp:Content>
